#include "stdafx.h"
#include "ckCheckCase.h"
#include "ckEnumCheckCase.h"

namespace ck
{
	EnumCheckCase::EnumCheckCase()
	{
	}


	EnumCheckCase::~EnumCheckCase()
	{
		Cleanup();
	}

	void EnumCheckCase::Add(CheckCase* pCase)
	{
		if (pCase)
		{
			m_cases.push_back(pCase);
		}
	}

	void EnumCheckCase::Cleanup()
	{
		std::vector<CheckCase*>::iterator iter;
		for (iter = m_cases.begin(); iter != m_cases.end(); iter++)
		{
			(*iter)->Release();
		}
		m_cases.clear();
	}

	void EnumCheckCase::Reset()
	{
		m_iter = m_cases.begin();
	}

	CheckCase* EnumCheckCase::Next()
	{
		if (m_iter == m_cases.end())
		{
			return NULL;
		}
		return *(m_iter++);
	}
}

